<template>
  <div class="layout-container">
    <el-container>
      <!-- 顶部导航 -->
      <el-header class="layout-header">
        <div class="header-title">
          <i class="el-icon-s-order"></i>
          关单任务管理平台
        </div>
      </el-header>

      <el-container>
        <!-- 侧边菜单 -->
        <el-aside width="200px" class="layout-aside">
          <el-menu
            :default-active="activeMenu"
            router
            background-color="#304156"
            text-color="#bfcbd9"
            active-text-color="#409EFF"
          >
            <el-menu-item index="/task">
              <i class="el-icon-s-order"></i>
              <span>任务管理</span>
            </el-menu-item>
            <el-menu-item index="/log">
              <i class="el-icon-document"></i>
              <span>下载日志</span>
            </el-menu-item>
            <el-menu-item index="/entry">
              <i class="el-icon-tickets"></i>
              <span>关单数据</span>
            </el-menu-item>
            <el-menu-item index="/log-monitor">
              <i class="el-icon-monitor"></i>
              <span>日志监控</span>
            </el-menu-item>
          </el-menu>
        </el-aside>

        <!-- 主内容区 -->
        <el-main class="layout-main">
          <router-view/>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  name: 'Layout',
  computed: {
    activeMenu() {
      return this.$route.path
    }
  }
}
</script>

<style scoped>
.layout-container {
  height: 100vh;
}

.layout-header {
  background-color: #304156;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.header-title {
  font-size: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
}

.layout-aside {
  background-color: #304156;
  min-height: calc(100vh - 60px);
}

.layout-main {
  background-color: #f0f2f5;
  padding: 20px;
}

.el-menu {
  border-right: none;
}
</style>

